<!-- INCLUDE ../include/title.html -->
<style type="text/css">
iframe {
    width: 100%;
    height: 400px;
}

.addnew{
    float: right;
}

</style>

<body>
    <!-- topbar starts -->
        <!-- INCLUDE ../include/header.html -->
    <!-- topbar ends -->
<div class="ch-container">
    <div class="row">
        
        <!-- left menu starts -->
            <!-- INCLUDE ../include/left.html -->
        <!-- left menu ends -->


        <div id="content" class="col-lg-10 col-sm-10">
        <input type="hidden" value='class' id="menu-type"/>
        <input type="hidden" value='' id="menu-val"/>
        <div class="box-inner">
            <div data-original-title="" class="box-header well">
                <h2>
                    <i class="glyphicon glyphicon-user"></i> <span id="topbars">分类管理</span>
                </h2>
                <div class="addnew">
                    <button class="btn btn-primary btn-xs  newtitle">添加新分类</button>
                </div>

                <div class="box-icon">
                    
                    <!--  a class="btn btn-minimize btn-round btn-default" href="#"><i class="glyphicon glyphicon-chevron-up"></i></a -->
                   
                </div>
            </div>

            

            <iframe id="main"  name="name" frameborder="0" scrolling="auto"  src="index.php?do=Class/class_list"></iframe>
          </div>
         <!-- foot starts -->
            <!-- INCLUDE ../include/foot.html -->
        <!-- foot ends -->
        </div>
   
    </div>
</div><!--/.fluid-container-->

<!-- INCLUDE ../include/bottom.html -->

<script type="text/javascript">
$(document).ready(function() {
    $("#main").css("height",$(document.body).height()-120);
    $(".iframelink").bind("click",function(){
        $("#main").attr("src",$(this).attr("hrefto"));
        var innertext = $(this).text();
        var s = $(this).parent().attr('class');

        try {
            if (s.indexOf("accordion")>-1){
                $("#topbars").html(innertext);               
            }
        }   catch(_e){
        }
       try {
            var menu = $(this).attr("menu");
            $("#menu-type").val(menu);
             $("#menu-val").val($(this).attr("menu-val"));
            var tms = '';
            switch (menu){
                case  'class':
                    tms = "添加新分类";
                    $(".addnew").show();
                    break;
                case 'channel' :
                    tms = '添加新频道';
                    $(".addnew").show();
                    break
                default :
                    $(".addnew").hide();
                    break;
            }
            $(".newtitle").html(tms);
            
       }catch(_e){

        
       }    
    })


    $(".addnew").bind('click',function(){
        var menutype = $("#menu-type").val();
        var menuval  = $("#menu-val").val();
        if (menutype=='class') {
            //alert(1);
            $("#main").attr("src",'index.php?do=Class/class_add');
            //tb_show('Add New Class','index.php?do=Class/class_add&TB_iframe=true&modal=true','');
        }else if (menutype=='channel' && menuval != ''){
            $("#main").attr("src",'index.php?do=Channel/channel_add');
        }

    })

} );


</script>

</body>
